home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 15 / BBS in a box XV-2.iso / Files II / Prog / T / Tools Plus 2.6 Evaluation.sit / Tools Plus 2.6 Evaluation Kit / Tools Plus 2.6 / User Manual / 01-Introduction < prev    next >
Encoding:
INI File  |  1995-04-01  |  18.6 KB  |  306 lines  |  [TEXT/ttxt]

  1. [Display using Monaco 9]
  2.  
  3.  
  4. 1  Introduction to Tools Plus
  5. ``````````````````````````````
  6.  
  7.  
  8. What is Tools Plus
  9. ``````````````````
  10.   Tools Plus is a set of powerful “GUI Building/Event Managing” libraries for Macintosh programmers using any of the following compilers:
  11.     • Symantec Corporation’s THINK C or Symantec C/C++
  12.     • Symantec Corporation’s THINK Pascal
  13.     • Metrowerks CodeWarrior C/C++ and CodeWarrior Pascal
  14.       (for 680x0 and PowerPC processors)
  15. Your specific developer kit includes only those libraries you selected when you bought Tools Plus.
  16.  
  17.   Over 170 high-powered “set and forget” routines let you easily create your application’s user interface, while Tools Plus maintains it for you and takes care of event management.
  18.  
  19.   In spite of its power and robust features, Tools Plus is easy to learn and easy to use, making it ideal for novices, intermediate developers, and experts.
  20.  
  21.   With Tools Plus, you have the advantage of enhanced functionality, automation, and full integration of: windows, floating palettes, tool bar, cursors, buttons, picture buttons, scroll bars, editing fields, list boxes, pull-down and hierarchical menus, pop-up menus, the Edit menu, clipboard, alerts, event handling, and more.  Once you create your user interface with Tools Plus’ routines, Tools Plus makes it work.  Virtually all Tools Plus routines can be executed with a single line of code.
  22.  
  23.   Using Tools Plus simplifies your programming and accelerates development.  You’ll create applications in less time, with less source code, with far fewer bugs, and with more features than if you use ordinary C/C++ or Pascal.
  24.  
  25.   Tools Plus libraries can be compiled into applications intended for System 5 and 6 (running under Finder and MultiFinder), System 7, and on the PowerPC (in emulated or native mode).
  26.  
  27.  
  28.  
  29.  
  30.  
  31. An Overview of Tools Plus
  32. `````````````````````````
  33.   To describe Tools Plus in a single sentence, it’s a “user interface builder/maintainer, and event manager.”  Its main function is to let you create a user interface without actually having to maintain it.  A simple example of this is the Apple menu.  With Tools Plus, you can give your application full reign over desk accessories just by creating the Apple menu with the AppleMenu routine.  Tools Plus automatically takes care of any activity pertaining to desk accessories, such as when the user selects a desk accessory from the Apple menu, repositions the accessory by dragging it, clicks buttons or types in the accessory, copies and pastes text in the desk accessory, and eventually closes it.  All this is handled automatically by Tools Plus (you don’t have to write any code for it).
  34.  
  35.   The thing that makes all this possible is Components: every routine in the Tools Plus libraries is a reusable, self-contained, and self-maintaining Component designed to be an integral part of your application.  Each Tools Plus Component is fully integrated with other Tools Plus Components, and with the Macintosh environment.
  36.  
  37.   The majority of Tools Plus’s routines are dedicated to creating and accessing elements of your application’s user interface, such as a push-button, an editing field or a picture button.  Once you have created a user interface element, you can forget about it.  Tools Plus takes care of the rest.  You can write your application using either Object Oriented Programming (OOP) or procedural (traditional) coding techniques.
  38.  
  39.   Tools Plus’s features integrate with each other according to the User Interface guidelines found in Inside Macintosh.  An active editing field, for example, automatically intercepts and processes key-strokes from the keyboard.  An editing field’s text can also be affected by the Edit menu, which lets the user Cut, Copy, Paste, and Clear the text, as well as transfer text between your application and other applications and desk accessories via the clipboard.  The Edit menu is automatically updated by the user’s actions in the active editing field: when an insertion point is in the field, the Edit menu’s “Cut” and “Copy” selections are disabled, since no text is selected for cutting or copying.  You can see how this frees you (the programmer) to do more important things, like writing programs!
  40.  
  41.  
  42. Not a Code Generator or Class Library
  43. `````````````````````````````````````
  44.   Tools Plus differs in many ways from code generators and class libraries (for object oriented programming).  It addresses the need to enhance productivity without inheriting the shortcomings if its predecessors.  Class libraries, although incredibly powerful and versatile, demand that you make a heavy investment in time to learn the libraries before you become proficient with them.  Tools Plus, on the other hand, is easy to learn.  Code generators do just that: they generate code.  Even though you don’t have to write the code yourself, you will inevitably have to understand the inner workings of that code.  Tools Plus libraries eliminate the need for thousands of lines of code, thereby making your application simpler and easier to maintain
  45.  
  46.   The heart-beat of Tools Plus is the polling routine, which is called by your application (instead of calling the Macintosh toolbox’s GetNextEvent or WaitNextEvent) to obtain events generated by the user, such as typing or mouse-clicks.  In fact, all events are obtained this way.  The big difference here is that Tools Plus’s polling routine does everything it possibly can before informing your application of an event.  Many events are processed internally and are never reported to your application, such as when the user types in an Editing Field (because the field automatically processes the typing).  Other events are reported to your application, such as when the user clicks a button.
  47.  
  48.   In contrast to other polling routines such as GetNextEvent or WaitNextEvent, Tools Plus’s polling routine translates the Macintosh’s events into something your application can use right away.  So instead of getting a low level “mouse down” event, your application gets a highly informative Tools Plus event such as: the “Save” button was selected in the “Add Customer” window (or button 4 was selected in window 15).
  49.  
  50.   The following example illustrates the difference between ordinary C or Pascal programming, and a program written with Tools Plus.  The left column represents the steps a traditional program has to take to detect and process a simple event, whereas the right column has the benefit of Tools Plus.  Note that the left column is highly simplified!
  51.  
  52.   Ordinary C or Pascal Programming         Programming with Tools Plus
  53. -----------------------------------  -----------------------------------
  54. 1 Get an event                       1 Get an event
  55.                                      -----------------------------------
  56. 2 Determine the type of event (a     = Button Selected event
  57.    “mouse-down”)                       (button 3 in window 15)
  58.  
  59. 3 Determine its location (a
  60.    window’s content region)
  61.  
  62. 4 Determine where in the window (a
  63.    “control”)
  64.  
  65. 5 Track the mouse in and out of the
  66.    control
  67.  
  68. 6 If the mouse button was released
  69.    inside the control’s region,
  70.    report that the control was
  71.    selected.  Otherwise ignore the
  72.    entire event.
  73. -----------------------------------
  74. = Mouse-down event
  75.   in a control (handle is known)
  76.   in a window (pointer is known)
  77.  
  78.  
  79.   Of course, additional steps could be taken in traditional C or Pascal to obtain a window number and button number, but at the expense of more programming.
  80.  
  81.  
  82.  
  83.  
  84.  
  85. Who can benefit from Tools Plus
  86. ```````````````````````````````
  87.   Just about anybody writing an application on the Macintosh in C/C++ or can benefit from using Tools Plus.  It’s useful to different people for different reasons:
  88.  
  89. • Novice programmers can start developing applications more readily and
  90.   with greater confidence.  The task of programming is simplified to
  91.   produce quicker results with fewer bugs.  And you don’t have to learn
  92.   a resource editor (such as Apple’s ResEdit) before you start using
  93.   Tools Plus.
  94.  
  95. • Seasoned programmers can use Tools Plus to develop an application in
  96.   less time and with fewer bugs.
  97.  
  98.  
  99.  
  100.  
  101.  
  102. What kind of applications can be written with Tools Plus
  103. ````````````````````````````````````````````````````````
  104.   Tools Plus does not limit you to writing certain kinds of applications, in that it does not preclude you from exercising your technical or creative skills on the Macintosh.  It merely helps simplify and manage the user interface and event processing that is so prevalent in Macintosh programs.  Varying programming needs are addressed by Tools Plus:
  105.  
  106. • Quick and Dirty applications can be written in less time.  These
  107.   programs can have all the features of finished Macintosh applications,
  108.   which makes them easier to work with.
  109.  
  110. • Full fledged applications that are suitable for shrink-wrapping can be
  111.   created using Tools Plus.
  112.  
  113. • Just about any program can be written more quickly and with less
  114.   effort by using Tools Plus.
  115.  
  116.  
  117.  
  118.  
  119.  
  120. What is Tools Plus not suitable for
  121. ```````````````````````````````````
  122.   Tools Plus is intended for application developers.  It was designed to be the event processing and translating engine within an application, so it definitely cannot be used to create the following:
  123.  
  124. • Drivers, control panels, INITs or system extensions
  125.  
  126. • CODE segments that can be incorporated into other applications, such
  127.   as 4th Dimension
  128.  
  129. • Desk accessories.  You can still use Tools Plus to write an
  130.   application that looks and feels like a desk accessory while running
  131.   under System 7.
  132.  
  133.  
  134.  
  135.  
  136.  
  137. System Requirements
  138. ```````````````````
  139.  
  140. Computer
  141. ````````
  142.   Tools Plus makes extensive use of ROM routines that are found only in the 128k ROMs (version 117) or higher.  Applications written with Tools Plus will run on the Macintosh 512KE (the “E” stands for enhanced with the new ROMs) or higher.  They will not run on a Lisa (also called a Macintosh XL), Macintosh 128K or a standard Macintosh 512K computer.  These applications will also run on Power Macintoshes.
  143.  
  144. Compiler
  145. ````````
  146. Tools Plus can be used by programmers developing with:
  147.    THINK C 5.0.4 or later
  148.    Symantec C/C++ 6.0.1 or later
  149.    Symantec C/C++ 7.0 or later
  150.    THINK Pascal 4.0.2 or later
  151.    CodeWarrior C/C++ 1.2.1 (68K or PPC) from the CW6 CD or later
  152.    CodeWarrior Pascal 950331 (68K or PPC) from the CW6 CD or later
  153.  
  154. Development Tools
  155. `````````````````
  156.   Every Macintosh developer should have a copy of ResEdit, Apple’s resource editor application.  It’s easy to use, indispensable, and best of all, free from your Apple dealer.  Always get the latest version (2.1.3 at this writing), since it’s always being upgraded and improved.  Beginners can get by without ResEdit, but you won’t want to.
  157.  
  158. System
  159. ``````
  160.   Applications created with Tools Plus can run under System 5, System 6 and System 7.  We recommend you use at least System 6 (optimally 6.0.8) or System 7 because Apple has fixed various bugs and many features have been added to the newer versions of the system.
  161.   While developing applications using Tools Plus, you will still have to observe the requirements and limitations of your development environment.  THINK C 5.0 and THINK Pascal 4.0 both require 2MB of RAM when using System 7.  CodeWarrior requires System 7 or higher.  Consult your compiler’s User Manual for details.
  162.  
  163. Memory
  164. ``````
  165.   Applications created with Tools Plus can run with less than 100k, depending on the complexity of your application.  The overhead associated with Tools Plus is in the neighborhood of 75k for 680x0 libraries and slightly higher for PowerPC native libraries.
  166.   While developing applications using Tools Plus, you will still have to observe the requirements and limitations of your development environment.  THINK C 5.0 and THINK Pascal 4.0 both require 2MB of RAM when using System 7.  CodeWarrior requires 8MB.  Consult your compiler’s User Manual for details.
  167.  
  168. Disk Space
  169. ``````````
  170.   Tools Plus libraries and related files require only a few hundred K of disk space.  When compiled, Tools Plus libraries add about 75k to your 680x0 application’s size, and about 120k to your PPC application’s size (add both 680x0 and PPC for fat binary applications).
  171.  
  172.   While developing applications using Tools Plus, you will still have to observe the requirements and limitations of your development environment.  THINK C 5.0 and THINK Pascal 4.0 both require about 2MB of disk space.
  173.  
  174. Finished Applications
  175. `````````````````````
  176.   Please be aware that you, as a programmer, have the capacity to write applications that have requirements far in excess of Tools Plus’s minimum system requirements.  It’s possible that you may choose to write a program that requires a math co-processor, System 7, 20 megabytes of RAM, and a pair of 20 inch color monitors.  Be aware that your finished application will likely have needs that exceed Tools Plus’s minimum requirements.
  177.  
  178.  
  179.  
  180.  
  181.  
  182. Assumptions made when writing this manual
  183. `````````````````````````````````````````
  184. Several assumptions have been made when writing this manual:
  185.  
  186. • You are already a C, C++ or Pascal programmer, or are learning to be
  187.   one on your own.  This manual does not teach you how to program in C
  188.   or Pascal, nor does it teach you how to use the Macintosh’s toolbox
  189.   routines.  It merely teaches you how to use Tools Plus.
  190.  
  191. • This manual makes no attempt to teach you how to use THINK C/C++,
  192.   THINK Pascal, CodeWarrior C/C++ or CodeWarrior Pascal.  Please consult
  193.   your User Manual in such matters, or contact the manufacturer of your
  194.   compiler.
  195.  
  196. • This manual makes no attempt to teach you how to use ResEdit, or any
  197.   other application or tool that is part of your development
  198.   environment.
  199.  
  200. • You already know how to use the Macintosh, and are familiar with its
  201.   terms such as clicking, dragging, selecting, etc.
  202.  
  203. • This manual does not assume that all programmers and users are male.
  204.   For the sake of easier reading, the term “he” implies either gender
  205.   within this manual.
  206.  
  207.  
  208.  
  209.  
  210.  
  211. Conventions used throughout this manual
  212. ```````````````````````````````````````
  213. 1)  Each Tools Plus routine is documented with both a C header and
  214.     Pascal interface.
  215.  
  216. 2)  Source code examples are given in Pascal, just like Inside
  217.     Macintosh.  In situations where the C source code differs (usually
  218.     due to differences in record structure), an example is also provided
  219.     in C.
  220.  
  221. 3)  The Pascal terms function and procedure are used throughout this
  222.     manual.  For the benefit of C programmers, a function is a routine
  223.     that returns a value.  The following table provides an example:
  224.  
  225.       Pascal Procedure:  procedure DeleteListBox(ListBox:INTEGER);
  226.         C  “Procedure”:  pascal void DeleteListBox(short ListBox);
  227.  
  228.       Pascal Function :  function FirstWindowNumber: integer;
  229.         C  “Function” :  pascal short FirstWindowNumber(void);
  230.  
  231. 4)  Important information is highlighted with notes and warnings...
  232.  
  233.        Note: A note that may be interesting or useful (don’t skip these)
  234.  
  235.        Warning:  A point you need to be cautious about.
  236.  
  237. 5)  This manual is not intended to replace Inside Macintosh or its
  238.     equivalent.  It does not detail the fundamentals of Macintosh
  239.     programming, such as screen versus window co-ordinate systems (local
  240.     versus global), commonly used structures (points, rectangles,
  241.     grafPort, etc.), using the Macintosh toolbox, etc.
  242.  
  243. 6)  For the benefit of new programmers, portions of this manual address
  244.     the basics of building a Macintosh application, such as some
  245.     differences between Finder and MultiFinder and how to complete a
  246.     double-clickable application.
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253. Software Updates
  254. ````````````````
  255.   Registered Tools Plus users are entitled to take advantage of our Software Update Program, which offers free updates as well as updates at reduced prices.  We recommend that you periodically check the Water’s Edge Software bulletin board on CompuServe (see the Technical Support chapter for details) to determine the latest version and information on how to upgrade.
  256.  
  257.   Water’s Edge Software is enhancing Tools Plus on an on-going basis by optimizing code and adding new features.  We will inform registered users of newly available updates either by mail or by electronic mail (if you provide us your e-mail account number, we will send you update information electronically).
  258.  
  259. Note: In order to ensure uninterrupted software update notification,
  260.       please inform us if your mailing address or e-mail account
  261.       changes.
  262.  
  263.  
  264.  
  265.  
  266.  
  267. Your Development Environment
  268. ````````````````````````````
  269.   This manual makes no attempt to teach you how to use your development environment, THINK C/C++ or THINK Pascal.  Please consult your THINK C/C++ or THINK Pascal User Manual in such matters, or contact the manufacturer, Symantec Corporation.
  270.  
  271.   Every Macintosh developer should have a copy of ResEdit, Apple’s resource editor application.  It’s easy to use, indispensable, and best of all, free from your Apple dealer.  Always get the latest version (2.1.1 at this writing), since it’s always being upgraded and improved.  Beginners can get by without ResEdit, but you won’t want to.
  272.  
  273.  
  274.  
  275.  
  276.  
  277. For your information (recommended reading)
  278. ``````````````````````````````````````````
  279.   For any Macintosh programmer, we suggest you either own or have access to the entire series of “Inside Macintosh” technical reference guides by Addison Wesley.  They are the definitive Macintosh bible for programmers of any caliber.  They’re worth their weight in midnight oil if you want to get into serious Macintosh programming.
  280.  
  281.   Another indispensable tool is THINK Reference, an on-line reference manual for C or Pascal programmers.  It describes all the Mac’s data structures, variables, constants, functions and procedures.  It also has valuable programming tips.
  282.  
  283.   To program a Macintosh, you’ll have to know the basics of the Macintosh toolbox.  We recommend the following:
  284.  
  285. • Get familiar with QuickDraw by reading chapter 6 of Inside Macintosh
  286.   Volume I (or equivalent).  This section details drawing in the
  287.   Macintosh’s graphic environment.
  288.  
  289. • Get familiar with the Font Manager by reading chapter 7 of Inside
  290.   Macintosh Volume I (or equivalent).  This section deals with drawing
  291.   text on the Macintosh’s screen
  292.  
  293. • Have a working knowledge of the Macintosh’s Memory Manager (chapter 3
  294.   of Inside Macintosh Volume I, or equivalent).  This section deals with
  295.   pointers, handles, and memory fragmentation.
  296.  
  297. • The thing that differentiates a good Macintosh application from the
  298.   rest of the world is that a user will find the program easy to learn
  299.   and use.  These benefits can be attributed greatly to a consistent and
  300.   well-designed user interface.  Learn the dos and don’ts of graphic
  301.   user interface (GUI) design, then learn some more!  Chapter 7 of
  302.   Inside Macintosh Volume I introduces you to the Macintosh’s GUI and
  303.   it’s standards.  Another good way of learning is to get exposure to
  304.   (and become familiar with) a wide range of Macintosh applications.
  305.   You’ll spot the good ones and the not so good ones after a while!
  306.